#pragma once
#define DEPENDENCY_PROPERTY(property_name, property_type)                                   \
    private: static Windows::UI::Xaml::DependencyProperty^  property_name##Property_ ;      \
                                                                                            \
    public: static property Windows::UI::Xaml::DependencyProperty^ property_name##Property  \
    {                                                                                       \
        Windows::UI::Xaml::DependencyProperty^ get()                                        \
        {                                                                                   \
            return property_name##Property_;                                                \
        }                                                                                   \
    }                                                                                       \
                                                                                            \
    public: property property_type property_name                                            \
    {                                                                                       \
        property_type get()                                                                 \
        {                                                                                   \
            return safe_cast<property_type>(GetValue(property_name##Property_));            \
        }                                                                                   \
        void set(property_type value)                                                       \
        {                                                                                   \
            SetValue(property_name##Property_, value);                                      \
        }                                                                                   \
    }                                                                                       


#define DEPENDENCY_PROPERTY_IMP(owner_class, property_name, property_type, default_value)\
Windows::UI::Xaml::DependencyProperty^  owner_class :: property_name##Property_ = Windows::UI::Xaml::DependencyProperty::Register(#property_name,\
                                                                                                            property_type::typeid, \
                                                                                                            owner_class::typeid, \
                                                                                                            ref new Windows::UI::Xaml::PropertyMetadata(default_value));

#define DEPENDENCY_PROPERTY_IMP_ONCHANGE(owner_class, property_name, property_type, default_value, on_change_method)\
Windows::UI::Xaml::DependencyProperty^  owner_class :: property_name##Property_ = Windows::UI::Xaml::DependencyProperty::Register(#property_name,\
                                                                                                            property_type::typeid, \
                                                                                                            owner_class::typeid, \
                                                                                                            ref new Windows::UI::Xaml::PropertyMetadata(default_value, ref new PropertyChangedCallback(&owner_class::on_change_method)));
#define CPPCX_AUTO_PROPERTY(property_name, property_type)   \
    private: property_type m_##property_name;               \
    public: property property_type property_name            \
    {                                                       \
        property_type get()                                 \
        {                                                   \
            return m_##property_name;                       \
        }                                                   \
        void set(property_type value)                       \
        {                                                   \
            m_##property_name = value;                      \
        }                                                   \
    }                                                       